/**
 * @author Nicolas CARPi <nico-git@deltablot.email>
 * @copyright 2012 Nicolas CARPi
 * @see https://www.elabftw.net Official website
 * @license AGPL-3.0
 * @package elabftw
 */

@import 'variables';
/* import this first to be able to modify bootstrap theme */
@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
/* override bootstrap theme */
$theme-colors: (
  'primary': $elabblue,
  'secondary': $medium,
  'danger': $dangerred,
  'neutral': $medium,
);
$dropdown-link-active-bg: $elabblue;
/* make the non active link in navbar have slightly more contrast */
$navbar-dark-color: $secondlevel;
$text-muted: $medium;
@import 'bootstrap/scss/bootstrap';
@import 'prismjs/themes/prism';
@import '@deltablot/dropzone/src/dropzone';
@import '@fancyapps/fancybox/dist/jquery.fancybox';
@import 'jquery-ui/themes/base/core';
@import 'jquery-ui/themes/base/autocomplete';
@import 'jquery-ui/themes/base/menu';
@import 'jquery-ui/themes/base/sortable';
@import 'jquery-ui/themes/base/theme';

@import './fontawesome/fontawesome';
@import './fontawesome/solid';
@import './fontawesome/brands';
@import './fontawesome/regular';
@import 'material-icons';

@import 'animations';
@import 'autocomplete';
@import 'footer';
@import 'header';
@import 'star-rating';
@import 'jsoneditor';
@import 'ove';
@import 'spreadsheet-editor';
@import 'search-syntax-highlighting';
@import 'tom-select';
@import 'tinymce-custom';

/* Font is Lato */
@font-face {
  font-display: swap;
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src:
    url('fonts/lato-regular.woff2') format('woff2'),
    url('fonts/lato-regular.ttf') format('truetype');
}
@font-face {
  font-display: swap;
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src:
    url('fonts/lato-italic.woff2') format('woff2'),
    url('fonts/lato-italic.ttf') format('truetype');
}

@font-face {
  font-display: swap;
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src:
    url('fonts/lato-bold.woff2') format('woff2'),
    url('fonts/lato-bold.ttf') format('truetype');
}

@font-face {
  font-display: swap;
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src:
    url('fonts/lato-bold-italic.woff2') format('woff2'),
    url('fonts/lato-bold-italic.ttf') format('truetype');
}

@font-face {
  font-display: swap;
  font-family: 'Lato';
  font-style: normal;
  font-weight: 900;
  src:
    url('fonts/lato-black.woff2') format('woff2'),
    url('fonts/lato-black.ttf') format('truetype');
}

@font-face {
  font-display: swap;
  font-family: 'Lato';
  font-style: italic;
  font-weight: 900;
  src:
    url('fonts/lato-black-italic.woff2') format('woff2'),
    url('fonts/lato-black-italic.ttf') format('truetype');
}

body {
  background: $mainbackground;
}

/* little shadow on top of the screen for no reasons */
/* TinyMCE selector for body in preview excluded to prevent flashing */
body::before,
.mce-preview-body::before {
  &:not(.no-shadow) {
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    content: '';
    left: 0;
    top: -10px;
    width: 100%;
  }
}

body::before {
  height: 10px;
  position: fixed;
  z-index: 100;
}

.mce-preview-body::before {
  height: 4rem;
  position: absolute;
}

/* this is the big white thing that holds everything */
#container {
  font: 100% 'Lato', Verdana, Arial, Helvetica, sans-serif;
  font-weight: 500;
  padding: 0;
}

/* holds the main content */
.real-container {
  margin: auto;
  margin-top: 20px;
  padding: 0 5%;
  /* reduce padding for small screen sizes */
  @media (max-width: 992px) {
    padding: 1%;
  }
}

/* LINKS */
a,
.link-like {
  color: $elabblue;
  text-decoration: none;
}

a:hover,
.link-like:hover {
  color: $elabblue;
  text-decoration: none;
}

/* add arrow going out of square icon after external links */
.external-link::after {
  content: '\f08e'; // arrow-up-right-from-square
  font-family: 'Font Awesome 6 Free';
  font-size: 0.6em;
  font-weight: 700;
  padding-left: 3px;
  vertical-align: text-top;
}

.underlined {
  text-decoration: underline !important;
}

/* LISTS */
.clean-list {
  margin: 0;
  padding: 0;
}

.group-list {
  margin: 0;
}

/* a toolbar button in blue */
.main-action-button {
  background-color: $elabblue;

  i {
    color: $white;
  }
}

select:not([multiple]) {
  appearance: none;
  background: #fff url('images/ico-arrow.png') no-repeat 97% 56%;
}

/* prevent the caret from being too close from text */
/* stylelint-disable-next-line selector-no-qualifying-type */
select.form-control {
  padding-right: 31px;
}

.form-control:focus {
  border-color: $elabblue;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(41, 174, 185, 0.6);
  z-index: 3;
}

/* textarea for metadata (extra fields) */
/* default size same as other inputs to keep harmony */
.form-textarea {
  min-height: 2rem;
  overflow: auto;
  resize: vertical;
}

/* fix bootstrap setting it to nowrap, it results in long content making the whole thing super wide */
.dropdown-item.wrap {
  white-space: normal;
}

.dropdown-item > a {
  color: $strongest;
}

.dropdown-item:hover a {
  color: $elabblue;
}

/* BLOCKQUOTE */
blockquote {
  background: #f9f9f9;
  border-left: 10px solid #ccc;
  margin: 1.5em 10px;
  padding: 0.5em 10px;
  quotes: '\201C''\201D''\2018''\2019';
}

blockquote::before {
  color: $firstlevel;
  content: open-quote;
  font-size: 4em;
  line-height: 0.1em;
  margin-right: 0.25em;
  vertical-align: -0.4em;
}

/* TITLES */
h1,
h2,
h3,
h4,
h5 {
  color: $medium;
  font-weight: normal;
  margin-top: 0;
}

h1 { font-size: 200%; }

h2 { font-size: 180%; }

h3 {
  font-size: 160%;
  margin: 0 auto;
}

h4 { font-size: 150%; }

h5 { font-size: 130%; }

/* HEAD */

/* BEGIN HELP CONTAINER */
.tip::before {
  color: $elabblue;
  content: '☺ ';
  font-size: 120%;
}

.tip {
  list-style: none;
}

/*  MENU is below main nav */
.tabbed-menu {
  border-bottom: 1px solid $firstlevel;
  line-height: 200%;
  margin: 30px 0 20px;
  padding: 0;

  li {
    display: inline;
    margin: 0;
    margin-right: 2%;

    button {
      border: 0;
      border-radius: 0;
      color: $medium;
      font-weight: 500;
      margin: 0;
      margin-bottom: 6px;
      padding: 0;
      text-transform: uppercase;
    }

    .selected {
      border-bottom: 6px solid $elabblue;
      margin-bottom: 0;
    }
  }
}

/* ALERT */
.alert {
  margin-top: 20px;
}

.alert a,
.alert a:hover {
  color: $mediumstrong;
}

.alert-success {
  background-color: $lightblue;
  border-color: $elabblue;
  color: $elabblue;

  .close {
    color: $elabblue;
  }
}

.alert-warning {
  border-color: $darkgold;

  .close {
    color: $darkgold;
  }

}

.alert-danger {
  background-color: $lightred;
  border-color: $darkred;
  color: $darkred;

  .close {
    color: $darkred;
  }

}

.hover-danger:hover {
  background-color: $lightred;
  border-color: $darkred;
  color: $darkred;
}

.hover-warning:hover {
  background-color: $warningbg;
}

.hover-action:hover {
  color: $elabblue;
  transition: color 0.8s ease;
}

button:disabled {
  cursor: not-allowed;
}

.separator {
  border-bottom: 1px solid $firstlevel;
  margin: 20px 0;
  padding-bottom: 30px;
}

/* beta ribbon */
.beta {
  background: $elabblue;
  border-radius: 5px;
  color: $white;
  display: inline-block;
  font-family: sans-serif;
  font-size: 10px;
  font-weight: bold;
  line-height: 80%;
  padding: 4px;
  position: relative;
  text-align: center;
  text-transform: uppercase;
  top: -12px;
  transform: rotate(35deg);
}

#body_view {
  /* https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
  /* we cannot apply strict here */
  contain: content;

  img {
    max-height: 100%;
    max-width: 100%;
  }

  p {
    // break super long words, see #4169
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}

/* fix for big images uploaded in the text */
.entity .txt {
  overflow: auto;
}

.table {
  /* display borders correctly, keeps cells flush without extra spacing. See #5681  */
  border-collapse: separate;
  border-spacing: 0;

  thead {
    position: sticky;
    top: 0;

    /* thead with no filter on top need to have this class to have a top border */
    /* stylelint-disable-next-line selector-no-qualifying-type */
    &.with-top {
      border-top: 1px solid $firstlevel;
    }

    th {
      border-bottom: $firstlevel 1px solid;
    }
  }

  tbody {
    background-color: $white;

    /* stylelint-disable-next-line selector-no-qualifying-type */
    &.bgnd-transparent {
      background-color: $mainbackground;
    }
  }

  td {
    width: fit-content;

    img {
      height: auto;
      max-width: 100%;
      object-fit: contain;
    }
  }

  th {
    white-space: nowrap;

    &:not(:last-child) {
      border-right: $firstlevel 1px solid;
    }
  }

  .no-wrap {
    white-space: nowrap;
  }
}

/* color one row every other row */
tr:nth-child(even) {
  background-color: $white;
}

tr:nth-child(odd) {
  background-color: $mainbackground;
}

/* the first row does not need a border-top */
tr:first-child td {
  border-top-width: 0;
}

/* enable responsive tables while preserving structure via horizontal scrolling (phone, tablets, etc.) */
.table-container {
  overflow-x: auto;
}

/* TABLE SHOW MODE */
.item-table {
  .title {
    font-size: 100%;
  }

  .item-date,
  .item-owner {
    white-space: nowrap;
  }

  .item-next {
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tags {
    max-width: 20ch;
  }

  .item-rating {
    min-width: 66px;
    text-align: center;
  }

  .item-owner a {
    color: $medium;

    &:hover {
      color: $secondlevel;
    }
  }
}

/* table in view mode, always add borders, see #4436 */
#body_view {
  table,
  td,
  tr {
    border: 1px solid $secondlevel;
  }
}

/* required labels/input */
.required-label::after {
  color: $dangerred;
  content: ' *';
}

.margin-1px {
  margin: 1px;
}

.vertical-separator {
  border-right: 1px solid $secondlevel;
  height: 1.8rem;
  margin-left: 1rem;
  margin-right: 1rem;

  /* separator disappears on small screens */
  @media (max-width: 550px) {
    border-right: 0;
    margin-left: 0;
    margin-right: 0.5rem;
  }
}

/* SHOW MODE */
.rating-show {
  background-color: $lightgold;
  font-size: 70%;

  i {
    color: $gold;
  }
}

/* NOTIFICATIONS */

/* container for notifications in top left of screen */
#overlay-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  left: 10px;
  position: fixed;
  top: 10px;
  z-index: 19850;
}

/* class for a single notification */
.overlay {
  border-radius: 5px;
  display: flex;
  line-height: 50px;
  opacity: 0.9;
  padding: 0 10px;
  // keep this above 1200 for tinymce fullscreen mode
  // see #2419
  // and over 15000 for open vector editor fullscreen mode
  z-index: 19850;
}

.overlay p {
  color: $white;
  font-weight: bold;
  margin-bottom: 0;
}

.overlay-success {
  animation: slideInOut 3.5s ease-in-out forwards;
  background-color: $elabblue;
}

.overlay-error,
.overlay-warning {
  animation: slideIn 3.5s ease-in forwards;

  span > i {
    color: $strongest;
  }

  &:hover {
    span > i {
      color: $darkred;
    }
  }
}

.overlay-error {
  background-color: $lightred;
}

.overlay-warning {
  background-color: $warningbg;
}

.overlay-error p,
.overlay-warning p {
  color: $strongest;
}

.opacity-8 {
  opacity: 0.8;
}

.full-screen-overlay {
  background: rgba(0, 0, 0, 0.8);
  height: 100vh;
  left: 0;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 1337;

  p {
    color: $white;
    left: 50%;
    opacity: 1;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1342;
  }
}

/* ENTITIES */
.entity {
  background-color: $white;
  border: 1px solid $firstlevel;
  border-left: 6px solid var(--left-color);
  border-radius: 5px;
  margin: 5px auto;
  max-width: 100%;
  min-width: 100%;
  opacity: var(--opacity);
  padding: 5px 10px 5px 5px;

  img {
    max-width: 100%;
  }

  p {
    margin-bottom: 0;
  }

  .fa-square-plus {
    color: $medium;
  }

  .fa-comments,
  .fa-paperclip,
  .fa-tags {
    color: $secondlevel;
  }

  .fa-tags {
    margin-top: 3px;
  }

  .owner {
    a {
      color: $medium;

      &:hover {
        color: $secondlevel;
      }
    }
  }

  .left-icon {
    padding: 8px 10px;

    i:not(.fa-lock) {
      color: $white;
    }

    .fa-lock {
      background-color: $firstlevel;
      color: $medium;
    }

    &.bgnd-blue {
      background-color: $elabblue;

      &:hover {
        background-color: $secondlevel;
      }
    }

    &.bgnd-dark {
      background-color: $medium;

      &:hover {
        background-color: $secondlevel;
      }
    }
  }
}

.entity-template {
  border: 1px dashed $firstlevel;
}

.entity-deleted-overlay {
  align-items: center;
  backdrop-filter: blur(1px);
  background: rgba(0, 0, 0, 0.5);
  color: $white;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 19850;
}

.bgnd-gray {
  background-color: $firstlevel;
}

/* make the text of buttons in bold to increase readability because contrast ratio is not great */
.btn {
  font-weight: bold;
}

.btn-dropdown-item {
  font-weight: 400;
  line-height: normal;
}

.btn-ghost {
  border: 1px solid $firstlevel;

  &:hover {
    background-color: $firstlevel;
    border-color: $secondlevel;
  }
}

/* SIDE PANEL */
.sidepanel-btn {
  border-radius: 0 5px 5px 0;
  padding: 10px 5px;

  &.sidepanel-closed {
    background-color: $firstlevel;
    border: 1px solid $firstlevel;
    box-shadow: -1rem 0 0 $firstlevel;

    i {
      color: $strongest;
    }

    &:hover {
      background-color: $secondlevel;
    }
  }

  &.sidepanel-opened {
    background-color: $mediumstrong;
    box-shadow: -1rem 0 0 $mediumstrong;

    i {
      color: $mainbackground;
    }

    &:hover {
      background-color: $medium;
    }
  }
}

.side-panel {
  background: $mediumstrong;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  color: $mainbackground;
  height: 100%;
  left: 0;
  overflow: hidden;
  overflow-y: auto;
  padding-top: 10px;
  position: fixed;
  top: 0;
  width: max(24%, 330px);

  hr {
    background-color: $mainbackground;
  }

  h2,
  h3,
  .fas,
  .far {
    color: $mainbackground;
  }

  .side-panel-item {
    padding: 5px 0 5px 10px;

    &.list-group-item {
      background-color: $mediumstrong;
      border: 0;
    }

    /* Favtags will show up as selected */
    &.selected {
      background-color: $elabblue;
      cursor: initial;
    }

    &:hover:not(.selected) {
      background-color: $medium;
    }

    i {
      color: $secondlevel;
    }

    .relative-moment {
      color: $secondlevel;
      font-size: 80%;
    }
  }

  /* Make the titles that you can click on to toggle the steps visibly clickable */
  [data-action='toggle-next']:hover {
    background-color: $medium;
  }
}

.item-info {
  padding-left: 20px;
}

.next-step-text {
  color: $medium;
  font-size: 80%;
  text-transform: uppercase;
}

/* for steps highlight, because .active only works on list-group-item */
.highlighted {
  border: 1px solid $elabblue;
}

.item-next {
  .item-next-step {
    color: $strongest;
  }
}

.item a p:hover {
  color: $elabblue;
}

.box {
  border: 1px solid $firstlevel;
  border-radius: 5px;
  margin-top: 10px;
  overflow: auto;
  padding: 20px;
}

.box section {
  margin-bottom: 15px;
}

/* EXPERIMENT STEPS */
/* this is a hack to make the steps that are long work fine in multiline
the form-control fails to do that so we do the border ourselves */
.step-static {
  border: 1px solid $firstlevel;
  border-bottom-right-radius: 4px;
  border-top-right-radius: 4px;
}

.finished {
  color: $green;
}

.draggable {
  cursor: move;
}

/* fix for bootstrap's thumbnail class */
.thumbnail {
  overflow: hidden;
  overflow-wrap: break-word;
}

.thumb {
  font-size: 100px !important;
  height: 100px;
  min-height: 50px;
  min-width: 50px;
  width: 100px;
}

/* highlight on hover: for editable/malleable elements
 * it's $elabblue but less opaque
 */
.hl-hover:hover {
  background-color: rgba(41, 174, 185, 0.5);
}

.hl-hover-gray:hover {
  background-color: $firstlevel;
}

.hl-hover-superlight:hover {
  background-color: $superlight;
}

.hl-hover-gray:focus-visible {
  background-color: $firstlevel;
  outline: none;
}

/* COMMENTS */
.comment-header {
  background-color: $firstlevel;
}


/* END COMMENTS */

@mixin breakable {
  hyphens: auto;
  line-height: 110%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.breakable {
  @include breakable;
}

/* links in tables (view mode) often contain long-name files. See #6137 */
#body_view a {
  @include breakable;
}

/* TITLE */
/* add several rules for the word-wrap, see https://stackoverflow.com/a/36555643 */
.title {
  @include breakable;
  font-size: 160%;

  /* titles inside item-table need to stay readable */
  .item-table & {
    font-size: 100%;
    hyphens: none;
    word-break: normal;
  }

  a {
    color: $mediumstrong;

    &:hover {
      color: $secondlevel;
    }
  }
}

/* for icons such as pin, need important to override default icon color */
.color-weak {
  color: $secondlevel !important;
}

.color-disabled {
  color: $disabled !important;
}

.color-medium {
  color: $medium;
}

.color-white {
  color: $white !important;
}

.color-blue {
  color: $elabblue !important;
}

.color-success {
  color: $elabblue !important;
}

.color-danger {
  color: $dangerred !important;
}

.border-danger {
  border: 1px solid $lightred !important;
}

.color-warning {
  color: $gold !important;
}

.lh-150 {
  line-height: 150%;
}

.lh-normal {
  line-height: normal;
}

.togglable-section-title {
  color: $medium;
  font-size: 100%;
  font-weight: bold;
  text-transform: uppercase;
}

/* Category and Status buttons */
.catstat-btn {
  border: 0;
  border-radius: 0.25rem;
  font-size: 75%;
  font-weight: bold;
  line-height: normal;
  padding: 0.25rem;
  text-transform: uppercase;

  /* Only Category */
  &.category-btn {
    background-color: var(--bg);
    color: $white;

    &:hover {
      background-color: $secondlevel;
    }
  }

  /* Only Status */
  &.status-btn {
    background-color: $firstlevel;
    color: $mediumstrong;

    &:hover {
      background-color: $secondlevel;
    }

    i {
      color: var(--bg);
    }
  }
}

.smallgray {
  color: $medium;
  font-size: 80%;
}

.small {
  font-size: 80%;
}

.text-big {
  font-size: 120%;
}

/* ucp.php */
#currpass {
  background-color: $lightblue;
  border: 1px solid $elabblue;
}

.edit-mode-label {
  min-width: 93px;

  @media (max-width: 992px) {
    min-width: 0;
  }
}

/* elabid */
.elabid {
  color: $medium;
  overflow-wrap: break-word;
}

/* TAGS */
.tag {
  background-color: $firstlevel;
  border-radius: 5px;
  color: $mediumstrong;
  font: bold 80% Verdana, Arial, Helvetica, sans-serif;
  padding: 2px 5px;

  &:hover {
    background-color: $mediumstrong;
    color: $white !important;
  }

  &.favorite {
    background-color: $gold;
  }
}

/* make the details shrink-to-fit and establish a positioning context */
.suggested-tags {
  display: inline-block;
  position: relative;
}

/* replace flex container with a responsive grid */
.suggested-tags-menu {
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: grid;
  gap: 0.25rem;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  margin-top: 6px;
  max-width: 40rem;
  padding: 0.5rem;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
}

.box {
  background-color: $white;
}

/* background for archived users */
.bg-medium {
  background-color: $secondlevel !important;
}

.border-secondlevel {
  border-color: $secondlevel;
}

.bg-firstlevel {
  background-color: $firstlevel;
}

/* print only the main div */
@media print {
  /* overwrite bootstrap defaults
     * https://stackoverflow.com/a/53232790
     */
  body {
    min-width: 0 !important;
  }

  /* don't print all that stuff */
  nav,
  footer,
  #menu,
  #filesDiv,
  #commentsDiv,
  #withSelected,
  .item-info > .clickable,
  .real-container > span,
  .real-container > hr,
  .real-container > form,
  .col-md-10,
  .col-md-2,
  .smallgray,
  .page-buttons {
    display: none !important;
  }

  .container {
    min-width: 0 !important;
    width: auto;
  }

  .real-container {
    margin: auto;
    padding: 0;
  }

  .real-container::after {
    content: 'Powered by eLabFTW ❤ www.elabftw.net';
    display: block;
    margin-top: 0.5rem;
    text-align: center;
  }

  .real-container .row:last-child {
    display: block;
    margin-top: 0.5rem;
  }

  .real-container .row:last-child .col-6 {
    max-width: 100%;
    padding: 0;
  }

  .elabid {
    text-align: left;
  }

  .title,
  .item-next,
  .item-info {
    padding-left: 5px !important;
  }

  .title a {
    text-decoration: none !important;
  }

  .entity {
    background-color: #fff;
    font-size: 14px;
    line-height: normal;
    margin: 0;
    margin-top: 2px;
    padding: 5px;
  }

  #itemList {
    display: block;
  }

  #itemList > div {
    display: block;
    max-width: 95% !important;
  }

  section > div {
    margin: 0 !important;
    padding: 5px;
    width: 100% !important;
  }

  #body_view {
    border: 0;
  }

  #itemList section {
    break-inside: avoid;
  }
}

// raise above .viewer-ove
.thumbnail > .dropdown {
  position: relative;
  z-index: 10;
}

/* icon overlay for uploaded file icons */
.icon-overlay {
  display: block;
  position: relative;
}

.icon-overlay:hover::after {
  background-color: $medium;
  color: $white;
  display: block;
  font-family: 'Font Awesome 6 Free';
  font-size: 3em;
  font-weight: 900;
  left: 50%;
  position: absolute;
  text-align: center;
  top: 37px;
  transform: translateX(-50%);
  width: 66px;
}

// edit-overlay
.icon-overlay.edit-overlay:hover::after {
  content: '\f304';
}
// eye-overlay
.icon-overlay.eye-overlay:hover::after {
  content: '\f06e';
}

/* fix the canvas for 3Dmoljs uploaded files */
/* stylelint-disable-next-line selector-class-pattern */
.viewer_3Dmoljs {
  height: 250px;
  position: relative;
  width: 100%;
}

/* Dropzone is the file uploader */
.dropzone {
  background-color: $white;
  border: 3px dashed $secondlevel;

  &:hover {
    border: 3px dashed $medium;
  }
}

.clickable:hover,
.editable:hover,
[data-action] {
  cursor: pointer;
}

/* trash icon is red on hover */
.fa-trash-alt:hover {
  color: $darkred;
  transition: color 0.8s ease;
}

/*
 * font awesome icons color
 * don't register clicks with the fontawesome icons
 * this way the click event is registered by the parent and all is well
 */
.far,
.fas,
.fab {
  color: $medium;
  pointer-events: none;
}

.fa-bell.active {
  color: $elabblue;
}

/* caption for tinymce */
.image {
  background: #f5f2f0;
  border: 1px solid $medium;
  display: inline-block;
  margin: 0 2px 0 1px;
}

.image img {
  margin: 8px 8px 0;
}

.image figcaption,
figure figcaption {
  margin: 6px 8px;
  text-align: center;
}

/* make the markdown editor full width */
.markdown-textarea {
  width: 100%;
}

/* styling TinyMCE preview */
/* stylelint-disable-next-line selector-class-pattern -- permit selecting classes with underscores */
.tox-dialog__header:has(+ .tox-dialog__content-js .mce-preview-body) {
  padding: 8px 16px 16px !important;
}

/* stylelint-disable-next-line selector-class-pattern -- permit selecting classes with underscores */
.tox-dialog__body-content:has(.mce-preview-body) {
  padding: 0 16px 16px !important;
}

/* setting the height as 'auto' results in the footer element being rendered below the preview popup */
/* stylelint-disable-next-line selector-class-pattern -- permit selecting classes with underscores */
.tox-dialog__content-js:has(.mce-preview-body) {
  height: 0 !important;
}

/* stylelint-disable-next-line selector-no-qualifying-type */
input[type='color'] {
  padding: 5px 10px;
}

.user-badge {
  background-color: $lightblue;
  border: 1px solid $firstlevel;
  border-radius: 0.25rem;
  padding: 4px 8px;
}

.admin-badge {
  background-color: $lightblue;
  border: 1px solid $gold;
  border-radius: 0.25rem;
  padding: 4px 8px;
  position: relative;

  &::before {
    color: $dangerred;
    content: 'Admin';
    font-size: 75%;
    left: 0;
    position: absolute;
    top: -16px;
  }
}

.increased-spacing {
  letter-spacing: 0.1rem;
}


/* give the togglePassword some borders like input */
.input-border {
  border: 1px solid #ced4da;
}

/* bring the search and user menu a bit more on the left
 * this is the only way I found that works
 * adding row/columns will mess up the left alignment of the navbar
 */
#main-nav {
  background-color: inherit;

  @media (min-width: 992px) {
    height: 43px;
  }

  /* prevent wrap on whitespace for elements of the menu so it doesn't take two lines when screen size is getting small */
  .nav-item {
    white-space: nowrap;
  }
}

/* to make the pie smaller */
.pie-chart-container {
  margin-left: auto;
  margin-right: auto;
  max-width: 360px;
  padding: 5%;
}

/* pure css pie chart based on: https://codepen.io/chriscoyier/pen/RPLqMg */
.pie-chart {
  background: conic-gradient(var(--pie-data));
  border-radius: 50%;
  height: 0;
  padding-right: 20px;
  padding-top: 100%;
  width: 100%;
}

.pie-percent {
  background: var(--bg);
  border-radius: 5px;
  color: $white;
  padding: 10px;
  text-align: center;
  text-shadow: 0 0 1px #000;
}

.fa-2x {
  font-size: 1.6em;
}

/* fix border radius for custom-select. brl = border radius left */
.brl-none {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
}

/* fix border radius for custom-select. brr = border radius right */
.brr-none {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}

/* SCROLL TO TOP OF PAGE BUTTON */
.floating-middle-right {
  position: fixed;
  right: 0.8%;
  top: calc(100vh - 15rem);

  /* make the up arrow white or we can't see it */
  svg {
    color: $white;
  }
}

#backToTopButton {
  transition: all 0.5s ease;

  i {
    color: $white;
  }
}

#scrollTopBtnAnchor {
  bottom: 0;
  position: absolute;
}
/* END BACK TO TOP BUTTON */

.border-white {
  border: 1px solid $mainbackground;
}

/* notifications */
.notification {
  border-top: 1px solid $mainbackground;

  .relative-moment {
    color: $medium;
    font-size: 80%;
  }
}

.notification[data-ack='0'] {
  background-color: $elabblue;

  span {
    color: $mainbackground;
  }
}


/* The switch - the box around the slider */
.switch {
  display: inline-block;
  height: 22px;
  position: relative;
  width: 42px;

  /* Hide default HTML checkbox */
  input {
    height: 0;
    opacity: 0;
    width: 0;
  }

  /* align the slider to the label in ucp */
  &.ucp-align {
    margin-top: 0.5rem;
  }

  &.disabled {
    opacity: 0.7;

    .slider {
      cursor: default;
    }
  }
}

/* The slider */
.slider {
  background-color: $medium;
  border-radius: 34px;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: 355ms;

  &::before {
    background-color: $white;
    border-radius: 50%;
    bottom: 2px;
    content: '';
    height: 18px;
    left: 2px;
    position: absolute;
    transition: 355ms;
    width: 18px;
  }
}

input:checked + .slider {
  background-color: $elabblue;
}

input:focus + .slider {
  box-shadow: 0 0 8px $elabblue;
}

input:checked + .slider::before {
  transform: translateX(20px);
}

/* :user-invalid only activates after the user interacted with an input
 * https://developer.mozilla.org/en-US/docs/Web/CSS/:user-invalid
 */
input:user-invalid {
  border: 1px solid $dangerred;
  box-shadow: 0 0 8px $dangerred;
}

.section-title {
  background-color: $firstlevel;
  font-size: 120%;
}

/* PROFILE page */
.counter {
  color: $medium;
}

/* see Enums/State */
.state-indicator {
  /* error */
  &[data-state='6'] {
    color: $darkred;
  }
  /* processing */
  &[data-state='5'] {
    animation: pulse 2s infinite;
    color: $orange;
  }
  /* pending */
  &[data-state='4'] {
    color: $mediumstrong;
  }
  /* normal */
  &[data-state='1'] {
    color: $green;
  }
}

@keyframes pulse {
  0%,
  100% {
    color: $brightorange; /* Bright orange */
  }

  50% {
    color: $lessbrightorange; /* Less bright orange */
  }
}

#exclusiveEditModeBtn {
  span {
    height: 1rem;
    line-height: 1rem;
    width: 1.25rem;

    i:first-child {
      top: -1.7px;
    }

    .fa-lock-open {
      left: -2px;
    }

    .fa-lock {
      left: -4px;
    }

    .fa-pen-nib {
      --fa-rotate-angle: 45deg;
      color: var(--primary);
      left: 2px;
      top: 4px;
    }
  }
}

#ketcher-root {
  display: flex;
  flex-direction: column;
  width: 100%;   /* Make the editor fill the entire width */
}

.ketcher-editor-container {
  display: flex;
  /*flex-grow: 1; /* Make the editor grow to fill available space */
  flex: 0 1 620px;
  flex-direction: column;
}

.ketcher-editor-container .editor {
  /*flex-grow: 1; /* Allow the drawing area to take up all remaining space */
  flex: 0 1 620px;
  min-height: 500px; /* Ensure a minimum height */
}

.ketcher-editor-container .toolbar {
  flex-shrink: 0; /* Ensure toolbars do not shrink */
}

#storageDiv {
  details,
  summary {
    margin: 10px 0;
  }
}

/* top right button */
.initials {
  color: $secondlevel;
  font-size: 1.5rem;
  font-weight: bold;
}

/* opencloning iframe */
#syc-root {
  height: 87vh;
  width: 100%;

  iframe {
    height: 100%;
    width: 100%;
  }
}

.round-spot {
  border-radius: 50%;
  display: inline-block;
  height: 1em;
  line-height: 1;
  vertical-align: middle;
  width: 1em;
}

.round-spot-ghost {
  border: 1px dashed $medium;
}

.calendar-event-hover {
  box-shadow: 5px 4px 4px $medium !important;
}

.calendar-event-disabled {
  opacity: 0.5;
}

.flash:hover {
  background-color: $elabblue;
  transition: background-color 0.1s ease;
}

.color-input {
  min-width: 116px;
}

.infotip {
  display: inline-block;   // shrink-wrap to content
  position: relative;

  &-icon {
    cursor: help;          // help cursor on hover
  }

  &-text {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 0.25em;
    color: $white;
    left: 50%;
    line-height: 1.3;
    margin: 0;
    max-width: 900px;
    min-width: 400px;
    opacity: 0;
    padding: 0.5em;
    pointer-events: none;  // doesn’t block mouse events
    position: absolute;
    text-align: start;
    top: 100%;             // just below the icon
    transform: translateX(-50%);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    visibility: hidden;
    z-index: 1985;
  }

  &:hover {
    .infotip-text {
      opacity: 1;
      visibility: visible;
    }
  }
}

.vertically-limited {
  max-height: 500px;
  overflow: scroll;
}

// disable touch action for doodle canvas
#doodleCanvas {
  touch-action: none;
}
